#region Summary

// 
// Owner : JackieHan 
// 
// Solution : DailyCollection 
// 
// Project : Jackie.Utility.Condition.Test
// 
// File : TestGreaterKeyWord.cs
// 
// CopyRight : Copyright © 2010-2011 Skomart Corporation, All Rights Reserved 
// 
// Summary : 测试关键字大于号的词法分析
// 
// History : 
//			2011-05-26 11:16:52	    Create 
// 

#endregion

#region Using

using System;
using Jackie.Utility.Condition.Domain.Define;
using Jackie.Utility.Condition.Domain.Interface;
using NUnit.Framework;

#endregion

namespace Jackie.Utility.Condition.Test.WordAnalyse
{
    /// <summary> 
    /// 测试关键字大于号的词法分析
    /// </summary>
    [TestFixture]
    public class TestGreaterKeyWord
    {
        private IWordAnalyser wordAnalyser;

        [SetUp]
        public void SetUp()
        {
            wordAnalyser = new DefaultWordsAnalyser();
        }

        [Test]
        public void TestWithRight()
        {
            var express = ">";
            var results = wordAnalyser.Analyse(express);

            Assert.AreEqual(1, results.Count);

            var result = results[0];
            Assert.IsInstanceOf(typeof(Greater), result.DefineType);
            Assert.AreEqual(express, result.Value);
        }

        [Test]
        public void TestWithWrong()
        {
            var express = ">;";
            var results = wordAnalyser.Analyse(express);

            Assert.Less(1, results.Count);
        }

        [TearDown]
        public void TearDown()
        {
        }

    }
}